package com.hspedu.controller;

import com.hspedu.hspspringmvc.annotation.Controller;
import com.hspedu.hspspringmvc.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@Controller
public class MonsterController {
    //springmvc支持原生servlet-api
    @RequestMapping("/list/monster")
    public void listMonster(HttpServletRequest request,
                            HttpServletResponse response){
        response.setContentType("text/html;charset=utf-8");
        try {
            PrintWriter writer = response.getWriter();
            writer.write("<h1>查询妖怪</h1>");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}
